package HomeWork;

import java.util.ArrayList;
import java.util.List;

/**
 * @description:
 * @Author yyp
 * @time 2022/3/25
 */
public class HomeWork02 {
    public static void main(String[] args) {
        Car car1 = new Car("a",100000);
        Car car2 = new Car("b",2501000);

        List<Car> list = new ArrayList<>();
        list.add(car1);list.add(car2);
        list.add(new Car("c",500000));
        System.out.println(list);
        list.remove(car1);
        System.out.println(list);
        System.out.println(list.contains(car2));
        System.out.println(list.size());
        System.out.println(list.isEmpty());
        list.addAll(list);
        System.out.println(list);
        System.out.println(list.containsAll(list));
        System.out.println(list.removeAll(list));
        System.out.println(list);
    }
}
class Car{
    String name;
    int value;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getValue() {
        return value;
    }

    public void setValue(int value) {
        this.value = value;
    }

    public Car(String name, int value) {
        this.name = name;
        this.value = value;
    }
}
